/* este va a ser el disparo de los diablillos del nivel 3 */
/*
struct Sxyda {                                                                  // for boomerangs
     int x;
     int y;
     int dir;
     int angulo;
     bool activo;
    }; 
dir 0=izquierda 1 centro 2 derecha;

*/

/* crea las formaciones de disparas */
void crea_gunshots(int x,int y,int dir)
{
  if (dir==0)   // formacion a la izquierda
  {
     gunshots[0].x=x;gunshots[0].y=y+32;
     gunshots[1].x=x;gunshots[1].y=y+32;
     gunshots[2].x=x;gunshots[2].y=y+32;         
     gunshots[3].x=x;gunshots[3].y=y+32;
  }  
  if (dir==2)  // formacion a la derecha
  {
     gunshots[0].x=x;gunshots[0].y=y+32;
     gunshots[1].x=x;gunshots[1].y=y+32;
     gunshots[2].x=x;gunshots[2].y=y+32;         
     gunshots[3].x=x;gunshots[3].y=y+32;
  }
  if (dir==1)  // formacion al centro.
  {
     gunshots[0].x=x;gunshots[0].y=y+32;
     gunshots[1].x=x;gunshots[1].y=y+32;
     gunshots[2].x=x;gunshots[2].y=y+32;         
     gunshots[3].x=x;gunshots[3].y=y+32;
  } 
    for (int i=0;i<4;i++) 
    { 
        gunshots[i].activo=true;
        gunshots[i].dir=dir;
    }
}             

void pinta_gunshots()
{
     for (int i=0;i<4;i++) 
     if (gunshots[i].activo==true)
     {
       /* MOVIMIENTO */  
      if (gunshots[i].dir==0.0)
      {
        gunshots[0].x-=0.5;gunshots[0].y+=0.5;
        gunshots[1].x-=0.6;gunshots[1].y+=0.8;
        gunshots[2].x-=0.6;gunshots[2].y+=1.0;         
        gunshots[3].x-=0.5;gunshots[3].y+=1.3;     
       }
      if (gunshots[i].dir==1.0)
      {
        gunshots[0].x+=0.5;gunshots[0].y+=0.5;
        gunshots[1].x+=0.6;gunshots[1].y+=0.8;
        gunshots[2].x+=0.6;gunshots[2].y+=1.0;         
        gunshots[3].x+=0.5;gunshots[3].y+=1.3;     
       } 
      if (gunshots[i].dir==2.0)
      {
        gunshots[0].x-=0.3;gunshots[0].y+=0.7;
        gunshots[1].x-=0.15;gunshots[1].y+=0.8;
        gunshots[2].x+=0.15;gunshots[2].y+=0.8;         
        gunshots[3].x+=0.3;gunshots[3].y+=0.7;     
       }              
       copon.x= gunshots[i].x;
       copon.y= gunshots[i].y;
       copon.pinta();
     }
}     
